package com.rimi.controller;

import com.rimi.bean.Video;
import com.rimi.service.WatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

import java.util.List;


/**
 * <p>
 * InnoDB free: 11264 kB; (`user_id`) REFER `owl_video/user`(`user_id`); (`video_id 前端控制器
 * </p>
 *
 * @author sky
 * @since 2018-06-06
 */
@Controller
public class WatchController {
    @Autowired
    private WatchService watchService;

    @RequestMapping("watchHistory/{userId}")
    public String watchHistory(@PathVariable Integer userId, Model model){
        List<Video> history = watchService.getWatchHistory(userId);
        model.addAttribute("watchHistory",history);
        return "";
    }
}

